#ifndef _DRV_EC600S_EVENT_H
#define _DRV_EC600S_EVENT_H

#include <EC600S_AT/AT_EC600S.h>
#include <EC600S_AT/AT_Mqtt.h>
#include <DRV_Event.h>
//#include <SVS_Time.h>

typedef enum{
    EC600S_CMD_EVENT = 0,
	EC600S_QPOWD_EVENT,    //命令复位
	EC600S_CGSN_EVENT,     //imei
    EC600S_CIMI_EVENT,     //imsi
    EC600S_QCCID_EVENT,    //qccid
    EC600S_ATI_EVENT,    //查询产品ID
    EC600S_GMR_EVENT,    //software version
    EC600S_QENG_EVENT,    //qeng
    EC600S_QCFG_NWSCANMODE_EVENT,    //NWSCANMODE
    EC600S_COPS_EVENT,    //at+cops?
    EC600S_CSQ_EVENT,    //at+csq
    EC600S_CCLK_EVENT,    //at+cclk
    EC600S_CGPADDR_EVENT,    //at+cgpaddr
    EC600S_CGMR_EVENT,    //at+cgmr
    EC600S_CGCONTRDP_EVENT,    //at+cgcontrdp
    EC600S_SOCK_OPEN_EVENT,    //socket open
    EC600S_SOCK_CLOSE_EVENT,    //socket close
    EC600S_SOCK_SEND_EVENT,    //socket send
    EC600S_SOCK_SENDEX_EVENT,    //socket sendex,16进制数据
    EC600S_FASTCONN_EVENT,
    EC600S_QMTCFG_EVENT,
    EC600S_QMTOPEN_EVENT,
    EC600S_QMTCLOSE_EVENT,
    EC600S_QMTCONN_EVENT,
    EC600S_QMTDISC_EVENT,
    EC600S_QMTSUB_EVENT,
    EC600S_QMTUNS_EVENT,
    EC600S_QMTPUBEX_EVENT,
	EC600S_MAX_EVENT,
}EN_EC600S_EVENT;

int EC600S_QPOWD_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CMD_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CGSN_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CIMI_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QCCID_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_ATI_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_GMR_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QENG_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QCFG_NWSCANMODE_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_COPS_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CSQ_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CCLK_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CGPADDR_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CGMR_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_CGCONTRDP_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_SOCK_OPEN_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_SOCK_CLOSE_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_SOCK_SEND_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_SOCK_SENDEX_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_FASTCONN_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTCFG_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTOPEN_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTCLOSE_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTCONN_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTDISC_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTSUB_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTUNS_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);
int EC600S_QMTPUBEX_EVENT_Func(int reqArgc, char *reqArgv[], int *retCode,int *rspArgc,char *rspArgv[]);

#define EC600S_EVENT_LIST    {\
    {.event=EC600S_CMD_EVENT,.evfunc=EC600S_CMD_EVENT_Func},\
	{.event=EC600S_QPOWD_EVENT,.evfunc=EC600S_QPOWD_EVENT_Func},\
    {.event=EC600S_CGSN_EVENT,.evfunc=EC600S_CGSN_EVENT_Func},\
    {.event=EC600S_CIMI_EVENT,.evfunc=EC600S_CIMI_EVENT_Func},\
    {.event=EC600S_QCCID_EVENT,.evfunc=EC600S_QCCID_EVENT_Func},\
    {.event=EC600S_ATI_EVENT,.evfunc=EC600S_ATI_EVENT_Func},\
    {.event=EC600S_GMR_EVENT,.evfunc=EC600S_GMR_EVENT_Func},\
    {.event=EC600S_QENG_EVENT,.evfunc=EC600S_QENG_EVENT_Func},\
    {.event=EC600S_QCFG_NWSCANMODE_EVENT,.evfunc=EC600S_QCFG_NWSCANMODE_EVENT_Func},\
    {.event=EC600S_COPS_EVENT,.evfunc=EC600S_COPS_EVENT_Func},\
    {.event=EC600S_CSQ_EVENT,.evfunc=EC600S_CSQ_EVENT_Func},\
    {.event=EC600S_CCLK_EVENT,.evfunc=EC600S_CCLK_EVENT_Func},\
    {.event=EC600S_CGPADDR_EVENT,.evfunc=EC600S_CGPADDR_EVENT_Func},\
    {.event=EC600S_CGMR_EVENT,.evfunc=EC600S_CGMR_EVENT_Func},\
    {.event=EC600S_CGCONTRDP_EVENT,.evfunc=EC600S_CGCONTRDP_EVENT_Func},\
    {.event=EC600S_SOCK_OPEN_EVENT,.evfunc=EC600S_SOCK_OPEN_EVENT_Func},\
    {.event=EC600S_SOCK_CLOSE_EVENT,.evfunc=EC600S_SOCK_CLOSE_EVENT_Func},\
    {.event=EC600S_SOCK_SEND_EVENT,.evfunc=EC600S_SOCK_SEND_EVENT_Func},\
    {.event=EC600S_SOCK_SENDEX_EVENT,.evfunc=EC600S_SOCK_SENDEX_EVENT_Func},\
    {.event=EC600S_FASTCONN_EVENT,.evfunc=EC600S_FASTCONN_EVENT_Func},\
    {.event=EC600S_QMTCFG_EVENT,.evfunc=EC600S_QMTCFG_EVENT_Func},\
    {.event=EC600S_QMTOPEN_EVENT,.evfunc=EC600S_QMTOPEN_EVENT_Func},\
    {.event=EC600S_QMTCLOSE_EVENT,.evfunc=EC600S_QMTCLOSE_EVENT_Func},\
    {.event=EC600S_QMTCONN_EVENT,.evfunc=EC600S_QMTCONN_EVENT_Func},\
    {.event=EC600S_QMTDISC_EVENT,.evfunc=EC600S_QMTDISC_EVENT_Func},\
    {.event=EC600S_QMTSUB_EVENT,.evfunc=EC600S_QMTSUB_EVENT_Func},\
    {.event=EC600S_QMTUNS_EVENT,.evfunc=EC600S_QMTUNS_EVENT_Func},\
    {.event=EC600S_QMTPUBEX_EVENT,.evfunc=EC600S_QMTPUBEX_EVENT_Func},\
}\

//对外提供通讯事件方式插叙设备状态接口函数,函数都为阻塞试
int EC600S_QPOWD_EVENT_DO(int timeout);
int EC600S_CMD_EVENT_DO(char *atcmd, char *rspcmd, int ato, int timeout);
int EC600S_CGSN_EVENT_DO(char *imei, int timeout);
int EC600S_CIMI_EVENT_DO(char *imsi, int timeout);
int EC600S_QCCID_EVENT_DO(char *iccid, int timeout);
int EC600S_ATI_EVENT_DO(char *pid, int timeout);
int EC600S_GMR_EVENT_DO(char *ver, int timeout);
int EC600S_QENG_EVENT_DO(ST_QENG *qeng, int timeout);
int EC600S_QCFG_NWSCANMODE_EVENT_DO(int scanmode, int timeout);
int EC600S_COPS_EVENT_DO(ST_COPS *cops, int timeout);
int EC600S_CSQ_EVENT_DO(ST_CSQ *csq, int timeout);
int EC600S_CCLK_EVENT_DO(ST_TIME *time, int timeout);
int EC600S_CGPADDR_EVENT_DO(char *ip, int timeout);
int EC600S_CGMR_EVENT_DO(char *ver, int timeout);
int EC600S_CGCONTRDP_EVENT_DO(char *apn, int timeout);
int EC600S_SOCK_OPEN_EVENT_DO(int sock, EN_SOCK_TYPE sock_type, EC600S_ADDR *to_addr, EC600S_ADDR *local_addr, int timeout);
int EC600S_SOCK_CLOSE_EVENT_DO(int sock, int timeout);
int EC600S_SOCK_SEND_EVENT_DO(int sock, U8 data[], int len, int timeout);
int EC600S_SOCK_SENDEX_EVENT_DO(int sock, U8 *data, int len, int timeout);
int EC600S_FASTCONN_EVENT_DO(ST_FASTCONN_EVENT_PARA *para, int timeout);
int EC600S_QMTCFG_EVENT_DO(ST_QMTCFG_EVENT_PARA *para, int timeout);
int EC600S_QMTOPEN_EVENT_DO(ST_QMTOPEN_EVENT_PARA *para, int timeout);
int EC600S_QMTCLOSE_EVENT_DO(ST_QMTCLOSE_EVENT_PARA *para, int timeout);
int EC600S_QMTCONN_EVENT_DO(ST_QMTCONN_EVENT_PARA *para, int timeout);
int EC600S_QMTDISC_EVENT_DO(ST_QMTDISC_EVENT_PARA *para, int timeout);
int EC600S_QMTSUB_EVENT_DO(ST_QMTSUB_EVENT_PARA *para, int timeout);
int EC600S_QMTUNS_EVENT_DO(ST_QMTUNS_EVENT_PARA *para, int timeout);
int EC600S_QMTPUBEX_EVENT_DO(ST_QMTPUBEX_EVENT_PARA *para, int timeout);

#endif

